<?php

require 'orm/om/BaseUserTeamPeer.php';


/**
 * Skeleton subclass for performing query and update operations on the 'user_team' table.
 *
 * 
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package    orm
 */
class UserTeamPeer extends BaseUserTeamPeer {

	
	/**
	 * Function to fetch the teams of the specific user 
	 * @param unknown_type $userId
	 */
	public static function getPlayerTeams($userId){
	
			$criteria = new Criteria();
			
			$criteria->add(UserTeamPeer::USER_ID, $userId)
							->add(UserTeamPeer::IS_ACTIVE, 'Y');
			
			// get the teams now			
			if(UserTeamPeer::doCount($criteria) > 0){
				
				$oTeams = UserTeamPeer::doSelect($criteria);
				return $oTeams;
				
			}else{
				return NULL;
			}
		
	}
	
} // UserTeamPeer
